#pragma once
#ifndef _fastbird_BoundingVolume_header_included_
#define _fastbird_BoundingVolume_header_included_

#include <Engine/SmartPtr.h>
#include <Engine/Math/Vec3.h>

namespace fastbird
{
	class Transformation;
	class Plane3;
	class Ray3;
	class BoundingVolume : public ReferenceCounter
	{
	public:
		enum BVType
		{
			BV_SPHERE,
			BV_BOX,
			BV_COUNT,
		};

		// Create default bounding volume which is a sphere
		static BoundingVolume* Create(BVType type = BV_SPHERE);

		virtual ~BoundingVolume(){}

		virtual int GetBVType() const = 0;
		virtual void SetCenter (const Vec3& center) = 0;
		virtual void SetRadius (float fRadius) = 0;
		virtual const Vec3& GetCenter () const = 0;
		virtual float GetRadius () const = 0;

		virtual void ComputeFromData(const Vec3* pVertices, size_t numVertices) = 0;
		virtual void TransformBy(const Transformation& transform,
			BoundingVolume* result) = 0;
		virtual int WhichSide(const Plane3& plane) const = 0;
		virtual bool TestIntersection(const Ray3& ray) const = 0;


	};
}
#endif //_fastbird_BoundingVolume_header_included_